# /usr/bin/env python3.6
# -*- encoding: utf-8 -*-
"""
@File    : model_utils.py
@Time    : 2020/2/6 0006 11:42
@Author  : zhangbing
@Email   : 18829172841@163.com
@Software: PyCharm
"""
from App.models.cinema_admin.cinema_user_model import CinemaUser


def get_cinema_user(user_ident):
    user = CinemaUser.query.get(user_ident)

    if user:
        return user

    user = CinemaUser.query.filter(CinemaUser.username == user_ident).first()

    if user:
        return user

    user = CinemaUser.query.filter(CinemaUser.phone == user_ident).first()

    if user:
        return user
    return None


if __name__ == "__main__":
    pass
